/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dds2.ServicesSystem.Modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carlos Asis
 */
@Entity
@Table(name = "tarrain")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarrain.findAll", query = "SELECT t FROM Tarrain t"),
    @NamedQuery(name = "Tarrain.findById", query = "SELECT t FROM Tarrain t WHERE t.id = :id"),
    @NamedQuery(name = "Tarrain.findByMeter", query = "SELECT t FROM Tarrain t WHERE t.meter = :meter"),
    @NamedQuery(name = "Tarrain.findByTomasdeAgua", query = "SELECT t FROM Tarrain t WHERE t.tomasdeAgua = :tomasdeAgua"),
    @NamedQuery(name = "Tarrain.findByIdUser", query = "SELECT t FROM Tarrain t WHERE t.idUser = :idUser")})
public class Tarrain implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "meter")
    private BigDecimal meter;
    @Column(name = "tomasdeAgua")
    private Integer tomasdeAgua;
    @Column(name = "idUser")
    private Integer idUser;

    public Tarrain() {
    }

    public Tarrain(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getMeter() {
        return meter;
    }

    public void setMeter(BigDecimal meter) {
        this.meter = meter;
    }

    public Integer getTomasdeAgua() {
        return tomasdeAgua;
    }

    public void setTomasdeAgua(Integer tomasdeAgua) {
        this.tomasdeAgua = tomasdeAgua;
    }

    public Integer getIdUser() {
        return idUser;
    }

    public void setIdUser(Integer idUser) {
        this.idUser = idUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tarrain)) {
            return false;
        }
        Tarrain other = (Tarrain) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return id+"" ;
    }
    
}
